package support

import (
	"yuanchang/spider/http"
)

type ChanSchedule struct {
	RequestChan chan *http.Request
}

func (cs *ChanSchedule) PushRequest(r *http.Request) {
	go func() {
		cs.RequestChan <- r
	}()
}

func (cs *ChanSchedule) PopRequest() *http.Request {
	return <-cs.RequestChan
}